<template>
    <div>
        <div class="bodysButton flex">
            <div>
                <el-button type="text" size="small" @click="$emit('bClock', bttonData)">修改</el-button>
            </div>
            <div class="">
                <el-button type="text" size="small" @click="showDel(bttonData)">删除</el-button>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    props: {
        bttonData: {
            type: Object,
            default: () => ({})
        }
    },
    data() {
        return {

        }
    },
    methods: {
        showDel(showDel) {
            this.$confirm(`确定要删除该数据吗？`, {
                type: "warning",
                //beforeClose 阻止关闭弹窗
                beforeClose: async (action, instance, done) => {

                    if (action === "confirm")  this.$emit('DataDel',showDel.id)
                    
                    done();

                }
            });
        }
    }
}
</script>
<style>
.bodysButton {
    width: 60px;
}

.bodysButton button {
    width: 60px;
}
</style>